package com.santu.edu.supporter.biz.order.kd.pojo.enums;

import com.santu.edu.supporter.exception.BizException;
import com.santu.edu.supporter.exception.CustomError;

/**
 * @author luoyaoqi
 * @createTime 2024/2/21
 * @description
 */
public enum KdProcessTypeEnum {
    /**
     *
     */
    WAIT_FOR_PICKUP(0,"等待取货"),
    PICKUP(1,"取货"),;

    private Integer code;

    private String desc;

    KdProcessTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }


    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static KdProcessTypeEnum convert(Integer code) {
        for (KdProcessTypeEnum e : KdProcessTypeEnum.values()) {
            if (e.getCode().equals(code)) {
                return e;
            }
        }
        throw BizException.causeBy(CustomError.ENUM_CONVERT_ERROR,"KdProcessTypeEnum转换异常");
    }
}
